home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / C / ASAP / fontcontentsheader.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-08  |  2.0 KB  |  51 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * AFontContentsHeader wrapper class                                         *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. #ifndef ASAP_FontContentsHeader_H
  12. #define ASAP_FontContentsHeader_H
  13.  
  14. #include <New.h>
  15.  
  16. extern "C"
  17. {
  18.  #include <Proto/DiskFont.h>
  19. }
  20.  
  21. class AFontContentsHeader : public FontContentsHeader
  22. {
  23.  public:
  24.  inline void DisposeFontContents();
  25.  inline void operator delete(void *);
  26.  inline static AFontContentsHeader * NewFontContents(BPTR fontsLock, STRPTR fontName);
  27.  inline void * operator new(size_t, BPTR fontsLock, STRPTR fontName);
  28. };
  29. //----------------------------------------------------------------------------
  30. void AFontContentsHeader::DisposeFontContents ()
  31. {
  32.  ::DisposeFontContents(this);
  33. }
  34. //----------------------------------------------------------------------------
  35. void AFontContentsHeader::operator delete(void *fontContentsHeader)
  36. {
  37.  ((AFontContentsHeader *) fontContentsHeader)->DisposeFontContents();
  38. }
  39. //----------------------------------------------------------------------------
  40. AFontContentsHeader * AFontContentsHeader::NewFontContents (BPTR fontsLock, STRPTR fontName)
  41. {
  42.  return (AFontContentsHeader *) ::NewFontContents(fontsLock, fontName);
  43. }
  44. //----------------------------------------------------------------------------
  45. void * AFontContentsHeader::operator new (size_t, BPTR fontsLock, STRPTR fontName)
  46. {
  47.  return AFontContentsHeader::NewFontContents(fontsLock, fontName);
  48. }
  49.  
  50. #endif
  51.